#!/bin/bash

TEMP=`mktemp -d`
function rmtemp () {
    rm -rf ${TEMP}
}
trap rmtemp EXIT

cd $TEMP
wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
if [ ! -f "$TEMP/nvim-linux64.tar.gz" ]; then
    echo 'download fail'
    exit
fi

tar xzvf nvim-linux64.tar.gz
sudo rm -rf /usr/local/nvim
sudo mv nvim-linux64 /usr/local/nvim


